#ifndef __MERCATOR__H
#define __MERCATOR__H

namespace mercator{

extern inline double DegreeToRad(double degree);
extern inline double RadToDegree(double rad);

const int kIterativeTimes = 10;
const double kIterativeValue = 0;
const double kBigSemiaxis = 6378137;
const double kSmallSemiaxis = 6356752.3142;
const double kStandardLatitude = DegreeToRad(30);
const double kStandardLongitude = DegreeToRad(0);
const double kPI = 3.1415926535897932;

inline double DegreeToRad(double degree) {
  return kPI*((double)degree/(double)180);            
}

inline double RadToDegree(double rad) {
  return (180*rad)/kPI;            
}

bool GeographyToCoordinate(double b, double l, double &x, double &y);
bool CoordinateToGeography(double x, double y, double &b, double &l);

}  // namespace mercator

#endif  // __MERCATOR__H

